﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace Super.Common
{
    /// <summary>
    /// xml操作辅助类； by 赵国伟 2010-11-08
    /// </summary>
    public class XmlHelper
    {

        #region "获得指定XML格式文档的指定节的值 by 赵国伟 2010-11-08"
        /// <summary>
        /// 获得指定XML格式文档的指定节的值
        /// </summary>
        /// <param name="xmlDoc"></param>
        /// <param name="nodeName"></param>
        /// <returns></returns>
        public static string GetSingleXmlNodeValue(string xmlDoc, string nodeName)
        {
            string nodeValue = "";
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(xmlDoc);
            XmlNodeList nodeList = doc.SelectNodes("//" + nodeName);
            if (nodeList != null)
            {
                nodeValue = nodeList[0].InnerText;
            }
            return nodeValue;
        }
        #endregion




    }
}
